import { DELETE, GET, POST, PUT } from '@/utils/request'

/**
 * 根据type获取课程列表
 * @param {Number} courseType 课程type value值
 */
export const getCourseByType = (courseType) => GET(`/course/getNames?courseType=${ courseType }`)

/**
 * 获取课设项目列表
 * @param {Number} pageNum
 * @param {Number} pageSize
 * @param {Number} courseId 课程id
 * @param {Number} cType 课程大类
 * @param {String} sortBy
 * @param {String} orderBy
 */
export const getCourseDesigns = (params) => GET('/admin/courseDesign', params)

/**
 * 获取课设项目详情
 */
export const getCourseDesign = (courseDesignId) => GET(`/courseDesign/${ courseDesignId }`)

/**
 * 删除课设项目
 */
export const removeCourseDesign = (courseDesignId) => DELETE(`/admin/courseDesign/${ courseDesignId }`)

/**
 * 审核课设
 */
export const checkCourseDesign = ({ courseDesignId, pass }) => POST(`/admin/courseDesign/check/${ courseDesignId }?pass=${ pass }`,)

